package com.app.designpatternslearn.structured.compositepattern.code

class Tree {

    var name: String? = null

    private val nodes = mutableListOf<Node>()

    fun add(node: Node) = nodes.add(node)

    fun remove(node: Node) = nodes.remove(node)
    override fun toString(): String {
        return "Tree(name=$name, nodes=$nodes)"
    }


}